<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			window.onload = function() {
				// 	var num = 789;
				// 	var a = num % 10;
				// 	var b = (num - a) % 100 / 10;
				// 	var c = (num - a - b*10) / 100
				// 	var num1 = a*100 + b*10 + c;
				// 	console.log(a,b,c,num1);
				// }
				
				// 将一个数字倒叙输出
				var num = 123456789;
				
				function dxddsg(num) {
					var num1 = '';
					num = num.toString();
					for (var i = num.length - 1; i >= 0; i--) {
						num1 += num[i];
					}
					console.log(parseInt(num1));
				}
				
				dxddsg(num);
			}
		</script>
	</body>
</html>
